﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LitJson;
using SinaApi;
using YGD.Generic;

namespace FollowManager.Web
{
    /// <summary>
    /// Summary description for Following
    /// </summary>
    public class Following : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {

            var service = new SinaBlogApiService();
            string data = service.GetFollowings();
            data.OL();
            var dataList = JsonMapper.ToObject<List<JsonData>>(data);
            dataList.Count.OL();

            foreach (var jsonData in dataList)
            {
                jsonData.OL();
            }
            
            context.Response.ContentType = "text/json";
            context.Response.Write(data);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}